local skel = fk.CreateSkill {
  name = "emo__ziduoyang",
}

Fk:loadTranslationTable{
  ["emo__ziduoyang"] = "自堕轮回阿鼻",
  [":emo__ziduoyang"] = "你可以将锦囊牌当作任意基本牌使用或打出。",
}

--- 可以转化的牌名
---@param player Player
local getNames = function (player)
  return player:getViewAsCardNames(skel.name, Fk:getAllCardNames("b"))
end

skel:addEffect("viewas", {
  pattern = ".|.|.|.|.|basic",
  prompt = "#emo__ziduolh-yang",
  handly_pile = true,
  interaction = function(self, player)
    local choices = getNames(player)
    if #choices > 0 then
      return UI.CardNameBox { choices = choices }
    end
  end,
  card_filter = function (self, player, to_select, selected)
    if #selected ~= 0 then return false end
    return Fk:getCardById(to_select).type == Card.TypeTrick
  end,
  view_as = function (self, player, cards)
    if #cards ~= 1 or Fk.all_card_types[self.interaction.data] == nil then return nil end
    local c = Fk:cloneCard(self.interaction.data)
    c.skillName = skel.name
    c:addSubcard(cards[1])
    return c
  end,
  enabled_at_play = function(self, player)
    return #getNames(player) > 0
  end,
  enabled_at_response = function (self, player, response)
    return #getNames(player) > 0
  end,
})

return skel
